# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=tls-fingerprinting
pkgver=257.4b6e878
pkgrel=3
pkgdesc='Tool and scripts to perform TLS Fingerprinting.'
groups=('blackarch' 'blackarch-fingerprint' 'blackarch-sniffer')
arch=('x86_64' 'aarch64')
url='https://github.com/LeeBrotherston/tls-fingerprinting'
license=('GPL3')
depends=('libpcap' 'python2')
makedepends=('git')
source=("git+https://github.com/LeeBrotherston/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd "$pkgname/fingerprintls"

  make
}

package() {
  cd $pkgname

  install -Dm 755 fingerprintls/fingerprintls \
    "$pkgdir/usr/bin/fingerprintls"
  install -Dm 755 scripts/fingerprintout.py "$pkgdir/usr/bin/fingerprintout"
  install -Dm 755 scripts/parselog.py "$pkgdir/usr/bin/parselog"
  install -Dm 644 -t "$pkgdir/usr/share/$pkgname" fingerprints/*
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md CHANGELOG
  install -Dm 644 LICENCE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

